package com.chefu.upload.config;


import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * oss初始化工具类对象
 */
@Configuration
public class OSSConfig {
    @Bean
    public OSS createOss(OSSProperties ossProperties) {
        return new OSSClientBuilder().build(
                ossProperties.getAccessKeyId(),
                ossProperties.getAccessKeySecret(),
                ossProperties.getEndpoint()
        );
    }
}
